package com.test.platform.network

import com.test.platform.model.DeveloperInfo
import com.test.platform.model.Project
import com.test.platform.model.PublishInfo
import com.test.platform.model.XTSReport
import retrofit2.Response
import retrofit2.http.*

interface ApiService {
    // DeveloperInfo 接口
    @GET("api/developer-info")
    suspend fun getAllDeveloperInfos(): List<DeveloperInfo>
    
    @GET("api/developer-info/{id}")
    suspend fun getDeveloperInfoById(@Path("id") id: Int): DeveloperInfo
    
    @POST("api/developer-info")
    suspend fun createDeveloperInfo(@Body developerInfo: DeveloperInfo): Response<DeveloperInfo>
    
    @PUT("api/developer-info/{id}")
    suspend fun updateDeveloperInfo(@Path("id") id: Int, @Body developerInfo: DeveloperInfo): DeveloperInfo
    
    @DELETE("api/developer-info/{id}")
    suspend fun deleteDeveloperInfo(@Path("id") id: Int)

    // Project 接口
    @GET("api/projects")
    suspend fun getAllProjects(): List<Project>
    
    @GET("api/projects/{id}")
    suspend fun getProjectById(@Path("id") id: Int): Project
    
    @POST("api/projects")
    suspend fun createProject(@Body project: Project): Project
    
    @PUT("api/projects/{id}")
    suspend fun updateProject(@Path("id") id: Int, @Body project: Project): Project
    
    @DELETE("api/projects/{id}")
    suspend fun deleteProject(@Path("id") id: Int)

    // PublishInfo 接口
    @GET("api/publish-info")
    suspend fun getAllPublishInfos(): List<PublishInfo>
    
    @GET("api/publish-info/{id}")
    suspend fun getPublishInfoById(@Path("id") id: Int): PublishInfo
    
    @POST("api/publish-info")
    suspend fun createPublishInfo(@Body publishInfo: PublishInfo): PublishInfo
    
    @PUT("api/publish-info/{id}")
    suspend fun updatePublishInfo(@Path("id") id: Int, @Body publishInfo: PublishInfo): PublishInfo
    
    @DELETE("api/publish-info/{id}")
    suspend fun deletePublishInfo(@Path("id") id: Int)

    // XTSReport 接口
    @GET("api/xts-reports")
    suspend fun getAllXTSReports(): List<XTSReport>
    
    @GET("api/xts-reports/{id}")
    suspend fun getXTSReportById(@Path("id") id: Int): XTSReport
    
    @POST("api/xts-reports")
    suspend fun createXTSReport(@Body xtsReport: XTSReport): XTSReport
    
    @PUT("api/xts-reports/{id}")
    suspend fun updateXTSReport(@Path("id") id: Int, @Body xtsReport: XTSReport): XTSReport
    
    @DELETE("api/xts-reports/{id}")
    suspend fun deleteXTSReport(@Path("id") id: Int)
}